<template>
  <div class="container">
    <Category title="美食">
      <img
        slot="center"
        src="https://s3.ax1x.com/2021/01/16/srJlq0.jpg"
        title="小羊肉串"
      />
      <a slot="footer" href="#">更多美食</a>
    </Category>

    <Category title="游戏">
      <ul slot="center">
        <li v-for="(value, index) in games" :key="index">{{ value }}</li>
      </ul>
      <div slot="footer" class="foot">
        <a href="#">更多游戏</a>
        <a href="#">害羞羞</a>
      </div>
    </Category>

    <Category title="电影">
      <video
        slot="center"
        controls
        src="http://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4"
      ></video>
      <!-- 新写法，只有用template包裹时才能用 v-slot -->
      <template v-slot:footer>
        <div class="foot">
          <a href="#">热门</a>
          <a href="#">推荐</a>
        </div>
        <h4>欢迎到电影院观看电影</h4>
      </template>
    </Category>
  </div>
</template>

<script>
import Category from "./components/Category.vue";
export default {
  name: "App",
  components: {
    Category,
  },
  data() {
    return {
      foods: ["虾巢", "肯德基", "华莱士", "邻几"],
      games: ["英雄联盟", "逆战", "穿越火线", "扣扣飞车"],
      films: ["《功夫》", "《康熙王朝》", "《好先生》", "《林正英家的李云龙》"],
    };
  },
};
</script>

<style>
.container,
.foot {
  display: flex;
  justify-content: space-around;
}

img {
  width: 100%;
}

video {
  width: 100%;
}

h4 {
  text-align: center;
}
</style>